<?php
namespace App\Api\Model;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class WallpaperModel extends Model{
    use SoftDeletes;//使用软删除
    protected $connection = 'mysql_wall';  //数据库连接名
    protected $table  = 'wallpapers';   //collection文档名
    protected $primaryKey = 'id';    //设置id
    //protected $fillable = ['id', 'name', 'phone'];  //设置字段白名单

    protected $dates = ['deleted_at'];
    public function setCidAttribute($value) {
        $this->attributes['cid'] = intval($value);
    }
}
